package com.example.blog.entity;

import com.example.blog.enums.CommentEnum;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.util.Date;

/**
 * @ClassName: TemperatureControlInfo
 * @Description: 点赞帖子

 * @Date 2023/9/9
 * @Version 1.0
 */
@Table(name = "LikePostOrComment")
@Data
@Slf4j
@Entity
@Builder
@DynamicInsert
@DynamicUpdate
@AllArgsConstructor
@NoArgsConstructor
public class LikePostOrComment {
    @Id
    @GeneratedValue(generator = "faceset_generator")
    @GenericGenerator(name = "faceset_generator", strategy = "uuid")
    @Column(name = "id",nullable = false,columnDefinition = "varchar(64) not null comment '主键id'")
    private String id;
    @Column(name = "status",nullable = false,columnDefinition ="varchar(1)  comment '点赞状态'")
    private Integer status;
    @Column(name = "contentId",nullable = false,columnDefinition ="varchar(64)  comment '点赞的id'")
    private String contentId;
    @Column(name = "likeTime",insertable = true,updatable = false,columnDefinition ="datetime  comment '点赞时间'")
    private Date likeTime;
    @Column(name = "userId",columnDefinition ="varchar(128)  comment '用户id'")
    private String userId ;
    @Enumerated(EnumType.STRING)
    private CommentEnum type;
}
